package audi.a4.control.core;

import java.util.ArrayList;

public class Cluster2Packet extends AbstractAudiA4Packet {

	public Cluster2Packet(double timeStamp,AudiA4CanCode code, int ID,ArrayList<String> data) {
		super(timeStamp, code,ID, data);
	}

	@Override
	public boolean validate(AudiA4CanCode code) {
		return code == AudiA4CanCode.CLUSTER_2;
	}

	@Override
	public void parse(int[] byteData) {
		int [] parsed = new int[6];
		parsed[0] = ((byteData[0]&0xf0)>>4);
		parsed[1] = (byteData[0] & 0x0F);
		parsed[2] = ((byteData[2]&0xf0)>>4);
		parsed[3] = (byteData[2] & 0x0F);
		parsed[4] = byteData[1];
		parsed[5] = byteData[3];
		setParsedData(parsed);
	}

}
